package cn.miketsu;

import cn.miketsu.downloader.CGDownloader;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Hello world!
 */
public class App {

    public static final File file;

    static {
        file = new File(System.getProperty("user.dir"), "config.properties");
        if (!file.exists()) {
            try {
                file.createNewFile();
                String dir = "filePath = fileDir";
                FileWriter fileWritter = new FileWriter(file.getName(),true);
                fileWritter.write(dir);
                fileWritter.close();
            } catch (IOException e) {
                System.out.println("创建配置文件失败！");
                e.printStackTrace();
                System.exit(0);
            }
        }
    }

    public static void main(String[] args) {
        try {
            CGDownloader.download();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
